From: Kenichi Handa Date: Thu, 13 Mar 2003 06:23:59 +0000 (+0000) Subject: (x-select-text): Don't set a text containing X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~53012 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=99b631c8bfeff7bfcf9a31abda79c03ccab0475b;p=emacs.git (x-select-text): Don't set a text containing eight-bit-control/graphic into the cut buffer. --- diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el index 5665d5a9471..c25b7402260 100644 --- a/lisp/term/x-win.el +++ b/lisp/term/x-win.el @@ -2126,14 +2126,20 @@ This is in addition to, but in preference to, the primary selection." (cond ((>= (length text) x-cut-buffer-max) (x-set-cut-buffer "" push) (setq x-last-selected-text-cut "")) + ((and (multibyte-string-p text) + (let ((charsets (find-charset-string text))) + (or (memq 'eight-bit-control charsets) + (memq 'eight-bit-graphic charsets)))) + (x-set-cut-buffer "" push) + (setq x-last-selected-text-cut "")) (t - (x-set-cut-buffer text push) + (x-set-cut-buffer text push) (setq x-last-selected-text-cut text))) (x-set-selection 'PRIMARY text) (setq x-last-selected-text-primary text) (when x-select-enable-clipboard - (x-set-selection 'CLIPBOARD text) - (setq x-last-selected-text-clipboard text)) + (x-set-selection 'CLIPBOARD text) + (setq x-last-selected-text-clipboard text)) ) ;;; Return the value of the current X selection.